
<%@ page import="fleet_management.VehicleDatabase"%>
<!doctype html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'vehicleDescription.label', default: 'VehicleDescription')}" />
<title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
	<a href="#list-vehicleDescription" class="skip" tabindex="-1"><g:message
			code="default.link.skip.label" default="Skip to content&hellip;" /></a>
	<div class="nav" role="navigation">
		<ul>
			<li><a class="home" href="${createLink(uri: '/')}"><g:message
						code="default.home.label" /></a></li>
			<li><g:link class="create" action="create">
					<g:message code="New Vehicle Database" args="[entityName]" />
				</g:link></li>
		</ul>
	</div>
	<div id="list-vehicleDescription" class="content scaffold-list"
		role="main">
		<h1>Vehicle Database</h1>
		<g:if test="${flash.message}">
			<div class="message" role="status">
				${flash.message}
			</div>
		</g:if>
		<div id="scrolls">
			<div id="tableWrapper">
				<table>
					<thead>
						<tr>

							<g:sortableColumn property="vehicleNumber"
								title="${message(code: 'vehicleDescription.vehicleNumber.label', default: 'VehicleNumber')}" />
								
								<g:sortableColumn property="adminRole"
								title="${message(code: 'vehicleDescription.adminRole.label', default: 'Region')}" />

							<g:sortableColumn property="vehicleType"
								title="${message(code: 'vehicleDescription.vehicleType.label', default: 'VehicleType')}" />

							<g:sortableColumn property="brandName"
								title="${message(code: 'vehicleDescription.brandName.label', default: 'BrandName')}" />

							<g:sortableColumn property="model"
								title="${message(code: 'vehicleDescription.model.label', default: 'Model')}" />

							<g:sortableColumn property="yearMade"
								title="${message(code: 'vehicleDescription.yearMade.label', default: 'YearMade')}" />

							<g:sortableColumn property="totalSeats"
								title="${message(code: 'vehicleDescription.totalSeats.label', default: 'TotalSeats')}" />

							<g:sortableColumn property="engineNumber"
								title="${message(code: 'vehicleDescription.engineNumber.label', default: 'EngineNumber')}" />

							<g:sortableColumn property="chassisNumber"
								title="${message(code: 'vehicleDescription.chassisNumber.label', default: 'ChassisNumber')}" />

							<g:sortableColumn property="blueBookValidity"
								title="${message(code: 'vehicleDescription.blueBookValidity.label', default: 'BlueBookValidity')}" />

							<g:sortableColumn property="pollutionCheck"
								title="${message(code: 'vehicleDescription.pollutionCheck.label', default: 'PollutionCheck')}" />

							<g:sortableColumn property="acquisitionDate"
								title="${message(code: 'vehicleDescription.acquisitionDate.label', default: 'AcquisitionDate')}" />

							<g:sortableColumn property="sourceOfFund"
								title="${message(code: 'vehicleDescription.sourceOfFund.label', default: 'SouceOfFund')}" />

							<g:sortableColumn property="duty"
								title="${message(code: 'vehicleDescription.duty.label', default: 'Duty')}" />

							<g:sortableColumn property="hand"
								title="${message(code: 'vehicleDescription.hand.label', default: 'Hand')}" />

							<g:sortableColumn property="fuelType"
								title="${message(code: 'vehicleDescription.fuelType.label', default: 'FuelType')}" />

							<g:sortableColumn property="totalCost"
								title="${message(code: 'vehicleDescription.totalCost.label', default: 'TotalCost')}" />

							<g:sortableColumn property="insuranceValidity"
								title="${message(code: 'vehicleDescription.insuranceValidity.label', default: 'InsuranceValidity')}" />

							<g:sortableColumn property="insuredAmount"
								title="${message(code: 'vehicleDescription.insuredAmount.label', default: 'InsuredAmount')}" />

							<g:sortableColumn property="premium"
								title="${message(code: 'vehicleDescription.premium.label', default: 'Premium')}" />

							

						</tr>
					</thead>

					<tbody>

						<g:each in="${vehicleDescriptionInstanceList}" status="i"
							var="vehicleDescriptionInstance">
							
							<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

								<td><g:link action="show"
										id="${vehicleDescriptionInstance.id}">
										${fieldValue(bean: vehicleDescriptionInstance, field: "vehicleNumber")}
									</g:link></td>
									
									<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "adminRole")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "vehicleType")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "brandName")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "model")}
								</td>

								<td><g:formatDate format="yyyy"
										date="${vehicleDescriptionInstance.yearMade}" /></td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "totalSeats")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "engineNumber")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "chassisNumber")}
								</td>

								<td><g:formatDate format="MMMM dd, yyyy"
										date="${vehicleDescriptionInstance.blueBookValidity}" /></td>

								<td><g:formatDate format="MMMM dd, yyyy"
										date="${vehicleDescriptionInstance.pollutionCheck}" /></td>

								<td><g:formatDate format="MMMM dd, yyyy"
										date="${vehicleDescriptionInstance.acquisitionDate}" /></td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "sourceOfFund")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "duty")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "hand")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "fuelType")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "totalCost")}
								</td>

								<td><g:formatDate format="MMMM dd, yyyy"
										date="${vehicleDescriptionInstance.insuranceValidity}" /></td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "insuredAmount")}
								</td>

								<td>
									${fieldValue(bean: vehicleDescriptionInstance, field: "premium")}
								</td>

								

							</tr>
							
						</g:each>

					</tbody>

				</table>
			</div>
		</div>
		<div class="pagination">
			<g:paginate total="${vehicleDescriptionInstanceTotal}" />
		</div>
	</div>
</body>
</html>
